#include "Blocks/CairnBlock.h"
#include "Blocks/StoneChunkBlock.h"
#include "Blocks/DiamondChunkBlock.h"
#include "Blocks/ExperienceBlock.h"
#include "Blocks/StickBlock.h"

namespace PocketSurvival
{
    int32_t CairnBlock::getIndex()
    {
        return Index();
    }

    const std::string &CairnBlock::getBlockName()
    {
        static std::string blockName = "CairnBlock";
        return blockName;
    }

    const std::vector<BoundingBox> &CairnBlock::getCustomCollisionBoxes(int32_t value)
    {
        return BlockConstans::cairnCollisionBoxes;
    }

    void CairnBlock::getDropValues(int32_t oldValue, int32_t newValue, int32_t toolLevel, std::vector<BlockDropValue> &dropValues)
    {
        int32_t num = Terrain::ExtractData(oldValue);
        int32_t num2 = 10 + 4 * num;
        int32_t num3 = ((num >= 3) ? 1 : 0);
        for (int32_t i = 0; i < 3; i++)
        {
            dropValues.push_back(BlockDropValue{ StoneChunkBlock::Index(), 1 });
        }
        for (int32_t j = 0; j < num2; j++)
        {
            dropValues.push_back(BlockDropValue{ ExperienceBlock::Index(), 1 });
        }
        for (int32_t k = 0; k < num3; k++)
        {
            dropValues.push_back(BlockDropValue{ DiamondChunkBlock::Index(), 1 });
        }
        for (int32_t l = 0; l < 2; l++)
        {
            dropValues.push_back(BlockDropValue{ StickBlock::Index(), 1 });
        }
    }
}